'''
单元测试
'''
import unittest
import sql
import test


class MyTestCase(unittest.TestCase):
    # 测试数据库插入
    def test_insert_music(self):
        self.assertEqual(sql.insert_music(11111111,'test'), 1)

    def test_insert_comments(self):
        self.assertEqual(sql.insert_comments('四季予你', '好喜欢听鸭'), 1)

    # 测试爬取热歌200首
    def test_get_hot_songs(self):
        self.assertEqual(len(test.hot_song_id), 200)

if __name__ == '__main__':
    unittest.main()
